import request from '@/utils/request'

export function oauthUrl(query) {
  return request({
    url: '/wecom/oauthUrl',
    method: 'get',
    params: query
  })
}

export function oauthUser(query) {
  return request({
    url: '/wecom/oauthUser',
    method: 'get',
    params: query
  })
}


export function queryString(name) {
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  var r = window.location.search.substr(1).match(reg);
  if (r != null) {
    return unescape(r[2]);
  }
  return null;
}

